package org.abacus.platform.database.impl;

import org.abacus.platform.database.Column;
import org.abacus.platform.database.Datasource;
import org.abacus.platform.database.Database;
import org.abacus.platform.database.DatabaseManager;
import org.abacus.platform.database.Table;
import org.abacus.platform.database.TableGroup;

public class DatabaseImpl extends Database {

	public DatabaseImpl() {
		super();
	}

	public DatabaseManager getDatabaseManager() {
		if (null == getConnectionProvider()) {
			throw new NullPointerException("connectionProvider = null");
		}
		return DatabaseManagerImpl.getInstance(getConnectionProvider());
	}

	public Table prepareTable() {
		return new TableImpl();
	}

	public TableGroup prepareTableGroup() {
		return new TableGroupImpl();
	}

	public Column prepareColumn() {
		return new ColumnImpl();
	}

	public Datasource prepareDatasource() {
		return new DatasourceImpl();
	}

}
